import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

// import "./assets/css/reset.css";
import "./assets/css/border.css";

import "@/assets/icons/index";
import SvgIcon from "@/components/svgIcon/index.vue";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import "element-plus/theme-chalk/display.css";

// 引入插件
import plugins from "./plugins";

// 引入mocks，测试接口
// if (process.env.VUE_APP_CURRENTMODE === 'dev') {
require("./mock");
// }

// 全局拖拽事件
import drag from "@/utils/drag";
// 全局右键菜单事件
import contextMenu from "@/utils/contextMenu";

// 上传组件
import uploader from "vue-simple-uploader";
import "vue-simple-uploader/dist/style.css";

// 全局样式引入
import "@/assets/styles/index.scss";

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.component("svg-icon", SvgIcon);
app.use(store).use(router).use(plugins).use(uploader).mount("#app");
app.directive("drag", drag).directive("contextMenu", contextMenu);
